(function ($) {

    var jPlayer = (function () {

        jPlayer.emulateMethods = "load play pause";

        jPlayer.emulateStatus = "src readyState networkState currentTime duration paused ended playbackRate";

        jPlayer.emulateOptions = "muted volume";

        jPlayer.reservedEvent = "ready flashreset resize repeat error warning";

        jPlayer.htmlEvent = ["loadstart", "abort", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "ratechange"];

        jPlayer.event = {
            ready:"jPlayer_ready",
            flashreset:"jPlayer_flashreset",
            resize:"jPlayer_resize",
            repeat:"jPlayer_repeat",
            click:"jPlayer_click",
            error:"jPlayer_error",
            warning:"jPlayer_warning",
            loadstart:"jPlayer_loadstart",
            progress:"jPlayer_progress",
            suspend:"jPlayer_suspend",
            abort:"jPlayer_abort",
            emptied:"jPlayer_emptied",
            stalled:"jPlayer_stalled",
            play:"jPlayer_play",
            pause:"jPlayer_pause",
            loadedmetadata:"jPlayer_loadedmetadata",
            loadeddata:"jPlayer_loadeddata",
            waiting:"jPlayer_waiting",
            playing:"jPlayer_playing",
            canplay:"jPlayer_canplay",
            canplaythrough:"jPlayer_canplaythrough",
            seeking:"jPlayer_seeking",
            seeked:"jPlayer_seeked",
            timeupdate:"jPlayer_timeupdate",
            ended:"jPlayer_ended",
            ratechange:"jPlayer_ratechange",
            durationchange:"jPlayer_durationchange",
            volumechange:"jPlayer_volumechange"
        };

        jPlayer.solution = {
            html:true,
            flash:true
        };

        jPlayer.format = {
            mp3:{
                codec:'audio/mpeg; codecs="mp3"',
                flashCanPlay:true,
                media:'audio'
            },
            m4a:{
                codec:'audio/mp4; codecs="mp4a.40.2"',
                flashCanPlay:true,
                media:'audio'
            },
            oga:{
                codec:'audio/ogg; codecs="vorbis"',
                flashCanPlay:false,
                media:'audio'
            },
            wav:{
                codec:'audio/wav; codecs="1"',
                flashCanPlay:false,
                media:'audio'
            },
            webma:{
                codec:'audio/webm; codecs="vorbis"',
                flashCanPlay:false,
                media:'audio'
            },
            fla:{
                codec:'audio/x-flv',
                flashCanPlay:true,
                media:'audio'
            },
            rtmpa:{
                codec:'audio/rtmp; codecs="rtmp"',
                flashCanPlay:true,
                media:'audio'
            },
            m4v:{
                codec:'video/mp4; codecs="avc1.42E01E mp4a.40.2"',
                flashCanPlay:true,
                media:'video'
            },
            ogv:{
                codec:'video/ogg; codecs="theora vorbis"',
                flashCanPlay:false,
                media:'video'
            },
            webmv:{
                codec:'video/webm; codecs="vorbis vp8"',
                flashCanPlay:false,
                media:'video'
            },
            flv:{
                codec:'video/x-flv',
                flashCanPlay:true,
                media:'video'
            },
            rtmpv:{
                codec:'video/rtmp; codecs="rtmp"',
                flashCanPlay:true,
                media:'video'
            }
        };

        jPlayer.timeFormat = {
            showHour:false,
            showMin:true,
            showSec:true,
            padHour:false,
            padMin:true,
            padSec:true,
            sepHour:":",
            sepMin:":",
            sepSec:""
        };

        jPlayer.convertTime = function (s) {
            var hour, min, myTime, sec, strHour, strMin, strSec;
            myTime = new Date(s * 1000);
            hour = myTime.getUTCHours();
            min = myTime.getUTCMinutes();
            sec = myTime.getUTCSeconds();
            strHour = jPlayer.timeFormat.padHour && hour < 10 ? "0" + hour : hour;
            strMin = jPlayer.timeFormat.padMin && min < 10 ? "0" + min : min;
            strSec = jPlayer.timeFormat.padSec && sec < 10 ? "0" + sec : sec;
            return (jPlayer.timeFormat.showHour ? strHour + jPlayer.timeFormat.sepHour : "") + (jPlayer.timeFormat.showMin ? strMin + jPlayer.timeFormat.sepMin : "") + (jPlayer.timeFormat.showSec ? strSec + jPlayer.timeFormat.sepSec : "");
        };

        jPlayer.browser = {};

        jPlayer.platform = {};

        jPlayer.count = 0;

        jPlayer.version = {
            script:"2.2.0",
            needFlash:"2.2.0",
            flash:"unknown"
        };

        jPlayer.instances = {};

        jPlayer.pause = function () {
            var element, _i, _len, _ref, _results;
            _ref = jPlayer.instances;
            _results = [];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                element = _ref[_i];
                _results.push(element.data("jPlayer").status.srcSet ? element.jPlayer("pause") : void 0);
            }
            return _results;
        };

        jPlayer._static_init = function () {
            var browser, browserMatch, platform, platformMatch, _uaBrowser, _uaPlatform;
            _uaBrowser = function (userAgent) {
                var match, rmozilla, rmsie, ropera, rwebkit, ua;
                ua = userAgent.toLowerCase();
                rwebkit = /(webkit)[ \/]([\w.]+)/;
                ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/;
                rmsie = /(msie) ([\w.]+)/;
                rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/;
                match = rwebkit.exec(ua) ||
                    ropera.exec(ua) ||
                    rmsie.exec(ua) ||
                    ua.indexOf("compatible") < 0 && rmozilla.exec(ua) ||
                    [];
                return {
                    browser:match[1] || "",
                    version:match[2] || "0"
                };
            };
            _uaPlatform = function (userAgent) {
                var platform, randroid, rmobile, rplatform, rtablet, tablet, ua;
                ua = userAgent.toLowerCase();
                rplatform = /(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/;
                rtablet = /(ipad|playbook)/;
                randroid = /(android)/;
                rmobile = /(mobile)/;
                platform = rplatform.exec(ua) || [];
                tablet = rtablet.exec(ua) ||
                    !rmobile.exec(ua) && randroid.exec(ua) ||
                    [];
                if (platform[1]) platform[1] = platform[1].replace(/\s/g, "_");
                return {
                    platform:platform[1] || "",
                    tablet:tablet[1] || ""
                };
            };
            browserMatch = _uaBrowser(navigator.userAgent);
            if (browserMatch.browser) {
                browser = {};
                browser[browserMatch.browser] = true;
                browser.version = browserMatch.version;
                jPlayer.browser = browser;
            }
            platformMatch = _uaPlatform(navigator.userAgent);
            if (platformMatch.platform) {
                platform = {};
                platform[platformMatch.platform] = true;
                platform.mobile = !platformMatch.tablet;
                platform.tablet = !!platformMatch.tablet;
                return jPlayer.platform = platform;
            }
        };

        jPlayer.prototype.options = {
            swfPath:"js",
            solution:"html, flash",
            supplied:"mp3",
            preload:'metadata',
            volume:0.8,
            muted:false,
            wmode:"opaque",
            backgroundColor:"#000000",
            cssSelectorAncestor:"#jp_container_1",
            cssSelector:{
                videoPlay:".jp-video-play",
                play:".jp-play",
                pause:".jp-pause",
                stop:".jp-stop",
                seekBar:".jp-seek-bar",
                playBar:".jp-play-bar",
                mute:".jp-mute",
                unmute:".jp-unmute",
                volumeBar:".jp-volume-bar",
                volumeBarValue:".jp-volume-bar-value",
                volumeMax:".jp-volume-max",
                currentTime:".jp-current-time",
                duration:".jp-duration",
                fullScreen:".jp-full-screen",
                restoreScreen:".jp-restore-screen",
                repeat:".jp-repeat",
                repeatOff:".jp-repeat-off",
                gui:".jp-gui",
                noSolution:".jp-no-solution"
            },
            fullScreen:false,
            autohide:{
                restored:false,
                full:true,
                fadeIn:200,
                fadeOut:600,
                hold:1000
            },
            loop:false,
            repeat:function (event) {
                if (event.jPlayer.options.loop) {
                    return $(this).unbind(".jPlayerRepeat").bind(jPlayer.event.ended + ".jPlayer.jPlayerRepeat", function () {
                        return $(this).jPlayer("play");
                    });
                } else {
                    return $(this).unbind(".jPlayerRepeat");
                }
            },
            nativeVideoControls:{},
            noFullScreen:{
                msie:/msie [0-6]/,
                ipad:/ipad.*?os [0-4]/,
                iphone:/iphone/,
                ipod:/ipod/,
                android_pad:/android [0-3](?!.*?mobile)/,
                android_phone:/android.*?mobile/,
                blackberry:/blackberry/,
                windows_ce:/windows ce/,
                webos:/webos/
            },
            noVolume:{
                ipad:/ipad/,
                iphone:/iphone/,
                ipod:/ipod/,
                android_pad:/android(?!.*?mobile)/,
                android_phone:/android.*?mobile/,
                blackberry:/blackberry/,
                windows_ce:/windows ce/,
                webos:/webos/,
                playbook:/playbook/
            },
            verticalVolume:false,
            idPrefix:"jp",
            noConflict:"jQuery",
            emulateHtml:false,
            errorAlerts:false,
            warningAlerts:false
        };

        jPlayer.prototype.optionsAudio = {
            size:{
                width:"0px",
                height:"0px",
                cssClass:""
            },
            sizeFull:{
                width:"0px",
                height:"0px",
                cssClass:""
            }
        };

        jPlayer.prototype.optionsVideo = {
            size:{
                width:"480px",
                height:"270px",
                cssClass:"jp-video-270p"
            },
            sizeFull:{
                width:"100%",
                height:"100%",
                cssClass:"jp-video-full"
            }
        };

        jPlayer.prototype.status = {
            src:"",
            media:{},
            paused:true,
            format:{},
            formatType:"",
            waitForPlay:true,
            waitForLoad:true,
            srcSet:false,
            video:false,
            seekPercent:0,
            currentPercentRelative:0,
            currentPercentAbsolute:0,
            currentTime:0,
            duration:0,
            readyState:0,
            networkState:0,
            playbackRate:1,
            ended:0
        };

        /*		Persistant status properties created dynamically at _init():
         width
         height
         cssClass
         nativeVideoControls
         noFullScreen
         noVolume
         */

        jPlayer.prototype.internal = {
            ready:false
        };

        function jPlayer(options, element) {
            if (arguments.length) {
                this.element = $(element);
                this.options = $.extend(true, {}, this.options, options);
                this.element.bind("remove.jPlayer", function () {
                    return this.destroy();
                });
                this._init();
            }
        }

        jPlayer.prototype._init = function () {
            var audioCanPlay, createParam, eventName, eventType, flashVars, format, htmlObj, objStr, param, paramStr, pushIfAvaliableAndNotExists, solution, solutionPriority, timeHandler, videoCanPlay, _i, _j, _k, _l, _len, _len2, _len3, _len4, _len5, _len6, _len7, _len8, _m, _n, _o, _ref, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8,
                _this = this;
            this.element.empty();
            this.status = $.extend({}, this.status);
            this.internal = $.extend({}, this.internal);
            this.internal.domNode = this.element.get(0);
            this.formats = [];
            this.solutions = [];
            this.require = {
                audio:false,
                video:false
            };
            this.htmlElement = {};
            this.html = {};
            this.html.audio = {};
            this.html.video = {};
            this.flash = {};
            this.css = {};
            this.css.cs = {};
            this.css.jq = {};
            this.ancestorJq = [];
            this.options.volume = this._limitValue(this.options.volume, 0, 1);
            pushIfAvaliableAndNotExists = function (values, avaliables, container) {
                var existsElement, found, value, _i, _j, _len, _len2, _ref, _results;
                _ref = values.toLowerCase().split(",");
                _results = [];
                for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                    value = _ref[_i];
                    value = value.replace(/^\s+|\s+$/g, "");
                    if (avaliables[value]) {
                        found = false;
                        for (_j = 0, _len2 = container.length; _j < _len2; _j++) {
                            existsElement = container[_j];
                            if ((found = value === existsElement)) break;
                        }
                        if (!found) {
                            _results.push(container.push(value));
                        } else {
                            _results.push(void 0);
                        }
                    } else {
                        _results.push(void 0);
                    }
                }
                return _results;
            };
            pushIfAvaliableAndNotExists(this.options.supplied, jPlayer.format, this.formats);
            pushIfAvaliableAndNotExists(this.options.solution, jPlayer.solution, this.solutions);
            this.internal.instance = "jp_" + jPlayer.count;
            jPlayer.instances[this.internal.instance] = this.element;
            if (!this.element.attr("id")) {
                this.element.attr("id", this.options.idPrefix + "_jplayer_" + jPlayer.count);
            }
            this.internal.self = $.extend({}, {
                id:this.element.attr("id"),
                jq:this.element
            });
            this.internal.audio = $.extend({}, {
                id:this.options.idPrefix + "_audio_" + jPlayer.count,
                jq:void 0
            });
            this.internal.video = $.extend({}, {
                id:this.options.idPrefix + "_video_" + jPlayer.count,
                jq:void 0
            });
            this.internal.flash = $.extend({}, {
                id:this.options.idPrefix + "_flash_" + jPlayer.count,
                jq:void 0,
                swf:this.options.swfPath + (this.options.swfPath.toLowerCase().slice(-4) !== ".swf" ? this.options.swfPath && this.options.swfPath.slice(-1) !== "/" ? "/" : "" + "Jplayer.swf" : "")
            });
            this.internal.poster = $.extend({}, {
                id:this.options.idPrefix + "_poster_" + jPlayer.count,
                jq:void 0
            });
            _ref = jPlayer.event;
            for (eventName in _ref) {
                eventType = _ref[eventName];
                if (this.options[eventName] !== void 0) {
                    this.element.bind(eventType + ".jPlayer", this.options[eventName]);
                    this.options[eventName] = void 0;
                }
            }
            _ref2 = this.formats;
            for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
                format = _ref2[_i];
                this.require[jPlayer.format[format].media] = true;
            }
            if (this.require.video) {
                this.options = $.extend(true, {}, this.optionsVideo, this.options);
            } else {
                this.options = $.extend(true, {}, this.optionsAudio, this.options);
            }
            this._setSize();
            this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls);
            this.status.noFullScreen = this._uaBlocklist(this.options.noFullScreen);
            this.status.noVolume = this._uaBlocklist(this.options.noVolume);
            this._restrictNativeVideoControls();
            this.htmlElement.poster = document.createElement('img');
            this.htmlElement.poster.id = this.internal.poster.id;
            this.htmlElement.poster.onload = function () {
                if (!_this.status.video || _this.status.waitForPlay) {
                    return _this.internal.poster.jq.show();
                }
            };
            this.element.append(this.htmlElement.poster);
            this.internal.poster.jq = $("#" + this.internal.poster.id);
            this.internal.poster.jq.css({
                'width':this.status.width,
                'height':this.status.height
            });
            this.internal.poster.jq.bind("click.jPlayer", function () {
                return _this._trigger(jPlayer.event.click);
            });
            this.html.audio.available = false;
            if (this.require.audio) {
                this.htmlElement.audio = document.createElement('audio');
                this.htmlElement.audio.id = this.internal.audio.id;
                this.html.audio.available = !!this.htmlElement.audio.canPlayType && this._testCanPlayType(this.htmlElement.audio);
            }
            this.html.video.available = false;
            if (this.require.video) {
                this.htmlElement.video = document.createElement('video');
                this.htmlElement.video.id = this.internal.video.id;
                this.html.video.available = !!this.htmlElement.video.canPlayType && this._testCanPlayType(this.htmlElement.video);
                this.flash.available = this._checkForFlash(10);
            }
            this.html.canPlay = {};
            this.flash.canPlay = {};
            _ref3 = this.formats;
            for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) {
                format = _ref3[_j];
                this.html.canPlay[format] = this.html[jPlayer.format[format].media].available && "" !== this.htmlElement[jPlayer.format[format].media].canPlayType(jPlayer.format[format].codec);
                this.flash.canPlay[format] = jPlayer.format[format].flashCanPlay && this.flash.available;
            }
            this.html.desired = false;
            this.flash.desired = false;
            _ref4 = this.solutions;
            for (solutionPriority = 0, _len3 = _ref4.length; solutionPriority < _len3; solutionPriority++) {
                solution = _ref4[solutionPriority];
                if (solutionPriority === 0) {
                    this[solution].desired = true;
                } else {
                    audioCanPlay = false;
                    videoCanPlay = false;
                    _ref5 = this.formats;
                    for (_k = 0, _len4 = _ref5.length; _k < _len4; _k++) {
                        format = _ref5[_k];
                        if (this[this.solutions[0]].canPlay[format]) {
                            if (jPlayer.format[format].media === 'video') {
                                videoCanPlay = true;
                            } else {
                                audioCanPlay = true;
                            }
                        }
                    }
                    this[solution].desired = (this.require.audio && !audioCanPlay) || (this.require.video && !videoCanPlay);
                }
            }
            this.html.support = {};
            this.flash.support = {};
            _ref6 = this.formats;
            for (_l = 0, _len5 = _ref6.length; _l < _len5; _l++) {
                format = _ref6[_l];
                this.html.support[format] = this.html.canPlay[format] && this.html.desired;
                this.flash.support[format] = this.flash.canPlay[format] && this.flash.desired;
            }
            this.html.used = false;
            this.flash.used = false;
            _ref7 = this.solutions;
            for (_m = 0, _len6 = _ref7.length; _m < _len6; _m++) {
                solution = _ref7[_m];
                _ref8 = this.formats;
                for (_n = 0, _len7 = _ref8.length; _n < _len7; _n++) {
                    format = _ref8[_n];
                    if ((this[solution].used = this[solution].support[format])) break;
                }
            }
            this._resetActive();
            this._resetGate();
            this._cssSelectorAncestor(this.options.cssSelectorAncestor);
            if (!(this.html.used || this.flash.used)) {
                this._error({
                    type:$.jPlayer.error.NO_SOLUTION,
                    context:"{solution:'" + this.options.solution + "', supplied:'" + this.options.supplied + "'}",
                    message:$.jPlayer.errorMsg.NO_SOLUTION,
                    hint:$.jPlayer.errorHint.NO_SOLUTION
                });
                if (this.css.jq.noSolution.length) this.css.jq.noSolution.show();
            } else {
                if (this.css.jq.noSolution.length) this.css.jq.noSolution.hide();
            }
            if (this.flash.used) {
                flashVars = "jQuery='" + (encodeURI(this.options.noConflict)) + "'&id='" + (encodeURI(this.internal.self.id)) + "'&vol='" + this.options.volume + "'&muted='" + this.options.muted;
                if (jPlayer.browser.msie && Number(jPlayer.browser.version) <= 8) {
                    objStr = '<object id="' + this.internal.flash.id + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0"></object>';
                    paramStr = ['<param name="movie" value="' + this.internal.flash.swf + '" />', '<param name="FlashVars" value="' + flashVars + '" />', '<param name="allowScriptAccess" value="always" />', '<param name="bgcolor" value="' + this.options.backgroundColor + '" />', '<param name="wmode" value="' + this.options.wmode + '" />'];
                    htmlObj = document.createElement(objStr);
                    for (_o = 0, _len8 = paramStr.length; _o < _len8; _o++) {
                        param = paramStr[_o];
                        htmlObj.appendChild(document.createElement(param));
                    }
                } else {
                    createParam = function (el, n, v) {
                        var p;
                        p = document.createElement("param");
                        p.setAttribute("name", n);
                        p.setAttribute("value", v);
                        return el.appendChild(p);
                    };
                    htmlObj = document.createElement("object");
                    htmlObj.setAttribute("id", this.internal.flash.id);
                    htmlObj.setAttribute("data", this.internal.flash.swf);
                    htmlObj.setAttribute("type", "application/x-shockwave-flash");
                    htmlObj.setAttribute("width", "1");
                    htmlObj.setAttribute("height", "1");
                    createParam(htmlObj, "flashvars", flashVars);
                    createParam(htmlObj, "allowscriptaccess", "always");
                    createParam(htmlObj, "bgcolor", this.options.backgroundColor);
                    createParam(htmlObj, "wmode", this.options.wmode);
                }
                this.element.append(htmlObj);
                this.internal.flash.jq = $(htmlObj);
            }
            if (this.html.used) {
                if (this.html.audio.available) {
                    this._addHtmlEventListeners(this.htmlElement.audio, this.html.audio);
                    this.element.append(this.htmlElement.audio);
                    this.internal.audio.jq = $("#" + this.internal.audio.id);
                }
                if (this.html.video.available) {
                    this._addHtmlEventListeners(this.htmlElement.video, this.html.video);
                    this.element.append(this.htmlElement.video);
                    this.internal.video.jq = $("#" + this.internal.video.id);
                    if (this.status.nativeVideoControls) {
                        this.internal.video.jq.css({
                            'width':this.status.width,
                            'height':this.status.height
                        });
                    } else {
                        this.internal.video.jq.css({
                            'width':'0px',
                            'height':'0px'
                        });
                    }
                    this.internal.video.jq.bind("click.jPlayer", function () {
                        return _this._trigger(jPlayer.event.click);
                    });
                }
                if (this.options.emulateHtml) this._emulateHtmlBridge();
            }
            if (this.html.used && !this.flash.used) {
                timeHandler = function () {
                    _this.internal.ready = true;
                    jPlayer.version.flash = "n/a";
                    _this._trigger(jPlayer.event.repeat);
                    return _this._trigger(jPlayer.event.ready);
                };
                setTimeout(timeHandler, 100);
                this._updateNativeVideoControls();
                this._updateInterface();
                this._updateButtons(false);
                this._updateAutohide();
                this._updateVolume(this.options.volume);
                this._updateMute(this.options.muted);
                if (this.css.jq.videoPlay.length) this.css.jq.videoPlay.hide();
            }
            return jPlayer.count++;
        };

        jPlayer.prototype.destroy = function () {
            var fn, jq, _ref;
            this.clearMedia();
            this._removeUiClass();
            if (this.css.jq.currentTime.length) this.css.jq.currentTime.text("");
            if (this.css.jq.duration.length) this.css.jq.duration.text("");
            _ref = this.css.jq;
            for (fn in _ref) {
                jq = _ref[fn];
                if (jq.length) jq.unbind(".jPlayer");
            }
            this.internal.poster.jq.unbind(".jPlayer");
            if (this.internal.video.jq) this.internal.video.jq.unbind(".jPlayer");
            if (this.options.emulateHtml) this._destroyHtmlBridge();
            this.element.removeData("jPlayer");
            this.element.unbind(".jPlayer");
            this.element.empty();
            return delete jPlayer.instances[this.internal.instance];
        };

        jPlayer.prototype.enable = function () {
            return {};
        };

        jPlayer.prototype.disable = function () {
            return {};
        };

        jPlayer.prototype._testCanPlayType = function (elem) {
            try {
                elem.canPlayType(jPlayer.format.mp3.codec);
                return true;
            } catch (error) {
                return false;
            }
        };

        jPlayer.prototype._uaBlocklist = function (list) {
            var block, p, re, ua;
            ua = navigator.userAgent.toLowerCase();
            block = false;
            for (p in list) {
                re = list[p];
                if ((block = re && re.test(ua))) break;
            }
            return block;
        };

        jPlayer.prototype._restrictNativeVideoControls = function () {
            if (this.require.audio && this.status.nativeVideoControls) {
                this.status.nativeVideoControls = false;
                return this.status.noFullScreen = true;
            }
        };

        jPlayer.prototype._updateNativeVideoControls = function () {
            if (this.html.video.available && this.html.used) {
                this.htmlElement.video.controls = this.status.nativeVideoControls;
                this._updateAutohide();
                if (this.status.nativeVideoControls && this.require.video) {
                    this.internal.poster.jq.hide();
                    return this.internal.video.jq.css({
                        'width':this.status.width,
                        'height':this.status.height
                    });
                } else if (this.status.waitForPlay && this.status.video) {
                    this.internal.poster.jq.show();
                    return this.internal.video.jq.css({
                        'width':'0px',
                        'height':'0px'
                    });
                }
            }
        };

        jPlayer.prototype._addHtmlEventListeners = function (mediaElement, entity) {
            var durationchangeHandler, endedHandler, errorHandler, eventType, pauseHandler, playHandler, playingHandler, progressHandler, seekedHandler, seekingHandler, suspendHandler, timeupdateHandler, volumechangeHandler, waitingHandler, _i, _len, _ref, _results,
                _this = this;
            mediaElement.preload = this.options.preload;
            mediaElement.muted = this.options.muted;
            mediaElement.volume = this.options.volume;
            progressHandler = function () {
                if (entity.gate) {
                    _this._getHtmlStatus(mediaElement);
                    _this._updateInterface();
                    return _this._trigger(jPlayer.event.progress);
                }
            };
            mediaElement.addEventListener("progress", progressHandler, false);
            timeupdateHandler = function () {
                if (entity.gate) {
                    _this._getHtmlStatus(mediaElement);
                    _this._updateInterface();
                    return _this._trigger(jPlayer.event.timeupdate);
                }
            };
            mediaElement.addEventListener("timeupdate", timeupdateHandler, false);
            durationchangeHandler = function () {
                if (entity.gate) {
                    _this._getHtmlStatus(mediaElement);
                    _this._updateInterface();
                    return _this._trigger(jPlayer.event.durationchange);
                }
            };
            mediaElement.addEventListener("durationchange", durationchangeHandler, false);
            playHandler = function () {
                if (entity.gate) {
                    _this._updateButtons(true);
                    _this._html_checkWaitForPlay();
                    return _this._trigger(jPlayer.event.play);
                }
            };
            mediaElement.addEventListener("play", playHandler, false);
            playingHandler = function () {
                if (entity.gate) {
                    _this._updateButtons(true);
                    _this._seeked();
                    return _this._trigger(jPlayer.event.playing);
                }
            };
            mediaElement.addEventListener("playing", playingHandler, false);
            pauseHandler = function () {
                if (entity.gate) {
                    _this._updateButtons(false);
                    return _this._trigger(jPlayer.event.pause);
                }
            };
            mediaElement.addEventListener("pause", pauseHandler, false);
            waitingHandler = function () {
                if (entity.gate) {
                    _this._seeking();
                    return _this._trigger(jPlayer.event.waiting);
                }
            };
            mediaElement.addEventListener("waiting", waitingHandler, false);
            seekingHandler = function () {
                if (entity.gate) {
                    _this._seeking();
                    return _this._trigger(jPlayer.event.seeking);
                }
            };
            mediaElement.addEventListener("seeking", seekingHandler, false);
            seekedHandler = function () {
                if (entity.gate) {
                    _this._seeked();
                    return _this._trigger(jPlayer.event.seeked);
                }
            };
            mediaElement.addEventListener("seeked", seekedHandler, false);
            volumechangeHandler = function () {
                if (entity.gate) {
                    _this.options.volume = mediaElement.volume;
                    _this.options.muted = mediaElement.muted;
                    _this._updateMute();
                    _this._updateVolume();
                    return _this._trigger(jPlayer.event.volumechange);
                }
            };
            mediaElement.addEventListener("volumechange", volumechangeHandler, false);
            suspendHandler = function () {
                if (entity.gate) {
                    _this._seeked();
                    return _this._trigger(jPlayer.event.suspend);
                }
            };
            mediaElement.addEventListener("seeked", suspendHandler, false);
            endedHandler = function () {
                if (entity.gate) {
                    if (!jPlayer.browser.webkit) _this.htmlElement.media.currentTime = 0;
                    _this.htmlElement.media.pause();
                    _this._updateButtons(false);
                    _this._getHtmlStatus(mediaElement, true);
                    _this._updateInterface();
                    return _this._trigger(jPlayer.event.ended);
                }
            };
            mediaElement.addEventListener("ended", endedHandler, false);
            errorHandler = function () {
                _this._updateButtons(false);
                _this._seeked();
                if (_this.status.srcSet) {
                    clearTimeout(_this.internal.htmlDlyCmdId);
                    _this.status.waitForLoad = true;
                    _this.status.waitForPlay = true;
                    if (_this.status.video && !_this.status.nativeVideoControls) {
                        _this.internal.video.jq.css({
                            'width':'0px',
                            'height':'0px'
                        });
                    }
                    if (_this._validString(_this.status.media.poster && !_this.status.nativeVideoControls)) {
                        _this.internal.poster.jq.show();
                    }
                    if (_this.css.jq.videoPlay.length) _this.css.jq.videoPlay.show();
                    return _this._error({
                        type:jPlayer.error.URL,
                        context:_this.status.src,
                        message:jPlayer.errorMsg.URL,
                        hint:jPlayer.errorHint.URL
                    });
                }
            };
            mediaElement.addEventListener("error", errorHandler, false);
            _ref = jPlayer.htmlEvent;
            _results = [];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                eventType = _ref[_i];
                _results.push(mediaElement.addEventListener(eventType, (function () {
                    if (entity.gate) return _this._trigger(jPlayer.event[eventType]);
                }), false));
            }
            return _results;
        };

        jPlayer.prototype._getHtmlStatus = function (media, override) {
            var cpa, cpr, ct, sp;
            ct = 0;
            cpa = 0;
            sp = 0;
            cpr = 0;
            if (isFinite(media.duration)) this.status.duration = media.duration;
            ct = media.currentTime;
            cpa = this.status.duration ? 100 * ct / this.status.duration : 0;
            if (typeof media.seekable === "object" && media.seekable.length > 0) {
                sp = this.status.duration > 0 ? 100 * media.seekable.end(media.seekable.length - 1) / this.status.duration : 100;
                cpr = this.status.duration > 0 ? 100 * media.currentTime / media.seekable.end(media.seekable.length - 1) : 0;
            } else {
                sp = 100;
                cpr = cpa;
            }
            if (override) {
                ct = 0;
                cpr = 0;
                cpa = 0;
            }
            this.status.seekPercent = sp;
            this.status.currentPercentAbsolute = cpa;
            this.status.currentPercentRelative = cpr;
            this.status.currentTime = ct;
            this.status.readyState = media.readyState;
            this.status.networkState = media.networkState;
            this.status.playbackRate = media.playbackRate;
            return this.status.ended = media.ended;
        };

        jPlayer.prototype._resetStatus = function () {
            return this.status = $.extend({}, this.status, jPlayer.prototype.status);
        };

        jPlayer.prototype._trigger = function (eventType, error, warning) {
            var event;
            event = $.Event(eventType);
            event.jPlayer = {};
            event.jPlayer.version = $.extend({}, jPlayer.version);
            event.jPlayer.options = $.extend(true, {}, this.options);
            event.jPlayer.status = $.extend(true, {}, this.status);
            event.jPlayer.html = $.extend(true, {}, this.html);
            event.jPlayer.flash = $.extend(true, {}, this.flash);
            if (error) event.jPlayer.error = $.extend({}, error);
            if (warning) event.jPlayer.warning = $.extend({}, warning);
            return this.element.trigger(event);
        };

        jPlayer.prototype.jPlayerFlashEvent = function (eventType, status) {
            var currentTime, paused;
            if (eventType === jPlayer.event.ready) {
                if (!this.internal.ready) {
                    this.internal.ready = true;
                    this.internal.flash.jq.css({
                        'width':'0px',
                        'height':'0px'
                    });
                    jPlayer.version.flash = status.version;
                    if (jPlayer.version.needFlash !== jPlayer.version.flash) {
                        this._error({
                            type:$.jPlayer.error.VERSION,
                            context:jPlayer.version.flash,
                            message:$.jPlayer.errorMsg.VERSION + jPlayer.version.flash,
                            hint:$.jPlayer.errorHint.VERSION
                        });
                    }
                    this._trigger(jPlayer.event.repeat);
                    this._trigger(eventType);
                } else {
                    if (this.flash.gate) {
                        currentTime = this.status.currentTime;
                        paused = this.status.paused;
                        this.setMedia(this.status.media);
                        if (currentTime > 0) {
                            if (paused) {
                                jPlayer.pause(currentTime);
                            } else {
                                this.play(currentTime);
                            }
                        }
                        this._trigger(jPlayer.event.flashreset);
                    }
                }
            }
            if (this.flash.gate) {
                switch (eventType) {
                    case jPlayer.event.progress:
                    case jPlayer.event.timeupdate:
                        this._getFlashStatus(status);
                        this._updateInterface();
                        this._trigger(eventType);
                        break;
                    case jPlayer.event.play:
                        this._seeked();
                        this._updateButtons(true);
                        this._trigger(eventType);
                        break;
                    case jPlayer.event.pause:
                    case jPlayer.event.ended:
                        this._updateButtons(false);
                        this._trigger(eventType);
                        break;
                    case jPlayer.event.click:
                        this._trigger(eventType);
                        break;
                    case jPlayer.event.error:
                        this.status.waitForLoad = true;
                        this.status.waitForPlay = true;
                        if (this.status.video) {
                            this.internal.flash.jq.css({
                                'width':'0px',
                                'height':'0px'
                            });
                        }
                        if (this._validString(this.status.media.poster)) {
                            this.internal.poster.jq.show();
                        }
                        if (this.css.jq.videoPlay.length && this.status.video) {
                            this.css.jq.videoPlay.show();
                        }
                        if (this.status.video) {
                            this._flash_setVideo(this.status.media);
                        } else {
                            this._flash_setAudio(this.status.media);
                        }
                        this._updateButtons(false);
                        this._error({
                            type:$.jPlayer.error.URL,
                            context:status.src,
                            message:$.jPlayer.errorMsg.URL,
                            hint:$.jPlayer.errorHint.URL
                        });
                        break;
                    case jPlayer.event.seeking:
                    case jPlayer.event.seeked:
                        this._seeking();
                        this._trigger(eventType);
                        break;
                    case jPlayer.event.ready:
                        break;
                    default:
                        this._trigger(eventType);
                }
            }
            return false;
        };

        jPlayer.prototype._getFlashStatus = function (status) {
            this.status.seekPercent = status.seekPercent;
            this.status.currentPercentRelative = status.currentPercentRelative;
            this.status.currentPercentAbsolute = status.currentPercentAbsolute;
            this.status.currentTime = status.currentTime;
            this.status.duration = status.duration;
            this.status.readyState = 4;
            this.status.networkState = 0;
            this.status.playbackRate = 1;
            return this.status.ended = false;
        };

        jPlayer.prototype._updateButtons = function (playing) {
            if (playing !== void 0) {
                this.status.paused = !playing;
                if (this.css.jq.play.length && this.css.jq.pause.length) {
                    if (playing) {
                        this.css.jq.play.hide();
                        this.css.jq.pause.show();
                    } else {
                        this.css.jq.play.show();
                        this.css.jq.pause.hide();
                    }
                }
            }
            if (this.css.jq.restoreScreen.length && this.css.jq.fullScreen.length) {
                if (this.status.noFullScreen) {
                    this.css.jq.fullScreen.hide();
                    this.css.jq.restoreScreen();
                } else if (this.options.fullScreen) {
                    this.css.jq.fullScreen.hide();
                    this.css.jq.restoreScreen.show();
                } else {
                    this.css.jq.fullScreen.hide();
                    this.css.jq.restoreScreen.hide();
                }
            }
            if (this.css.jq.repeat.length && this.css.jq.repeatOff.length) {
                if (this.options.loop) {
                    this.css.jq.repeat.hide();
                    return this.css.jq.repeatOff.show();
                } else {
                    this.css.jq.repeat.show();
                    return this.css.jq.repeatOff.hide();
                }
            }
        };

        jPlayer.prototype._updateInterface = function () {
            if (this.css.jq.seekBar.length) {
                this.css.jq.seekBar.width(this.status.seekPercent + "%");
            }
            if (this.css.jq.playBar.length) {
                this.css.jq.playBar.width(this.status.currentPercentRelative + "%");
            }
            if (this.css.jq.currentTime.length) {
                this.css.jq.currentTime.text(jPlayer.convertTime(this.status.currentTime));
            }
            if (this.css.jq.duration.length) {
                return this.css.jq.duration.text(jPlayer.convertTime(this.status.duration));
            }
        };

        jPlayer.prototype._seeking = function () {
            if (this.css.jq.seekBar.length) {
                return this.css.jq.seekBar.addClass("jp-seeking-bg");
            }
        };

        jPlayer.prototype._seeked = function () {
            if (this.css.jq.seekBar.length) {
                return this.css.jq.seekBar.removeClass("jp-seeking-bg");
            }
        };

        jPlayer.prototype._resetGate = function () {
            this.html.audio.gate = false;
            this.html.video.gate = false;
            return this.flash.gate = false;
        };

        jPlayer.prototype._resetActive = function () {
            this.html.active = false;
            return this.flash.active = false;
        };

        jPlayer.prototype.setMedia = function (media) {
            var format, formatPriority, isHtml, isVideo, posterChanged, solution, solutionPriority, supported, _len, _len2, _ref, _ref2;
            supported = false;
            posterChanged = this.status.media.poster !== media.poster;
            this._resetMedia();
            this._resetGate();
            this._resetActive();
            _ref = this.formats;
            for (formatPriority = 0, _len = _ref.length; formatPriority < _len; formatPriority++) {
                format = _ref[formatPriority];
                isVideo = jPlayer.format[format].media === 'video';
                _ref2 = this.solutions;
                for (solutionPriority = 0, _len2 = _ref2.length; solutionPriority < _len2; solutionPriority++) {
                    solution = _ref2[solutionPriority];
                    if (this[solution].support[format] && this._validString(media[format])) {
                        isHtml = solution === 'html';
                        if (isVideo) {
                            if (isHtml) {
                                this.html.video.gate = true;
                                this._html_setVideo(media);
                                this.html.active = true;
                            } else {
                                this.flash.gate = true;
                                this._flash_setVideo(media);
                                this.flash.active = true;
                            }
                            if (this.css.jq.videoPlay.length) this.css.jq.videoPlay.show();
                            this.status.video = true;
                        } else {
                            if (isHtml) {
                                this.html.audio.gate = true;
                                this._html_setAudio(media);
                                this.html.active = true;
                            } else {
                                this.flash.gate = true;
                                this._flash_setAudio(media);
                                this.flash.active = true;
                            }
                            if (this.css.jq.videoPlay.length) this.css.jq.videoPlay.hide();
                            this.status.video = false;
                        }
                        supported = true;
                        break;
                    }
                }
                if (supported) break;
            }
            if (supported) {
                if (!(this.status.nativeVideoControls && this.html.video.gate)) {
                    if (this._validString(media.poster)) {
                        if (posterChanged) {
                            this.htmlElement.poster.src = media.poster;
                        } else {
                            this.internal.poster.jq.show();
                        }
                    }
                }
                this.status.srcSet = true;
                this.status.media = $.extend({}, media);
                this._updateButtons(false);
                return this._updateInterface();
            } else {
                return this._error({
                    type:$.jPlayer.error.NO_SUPPORT,
                    context:"{supplied:'" + this.options.supplied + "'",
                    message:$.jPlayer.errorMsg.NO_SUPPORT,
                    hint:$.jPlayer.errorHint.NO_SUPPORT
                });
            }
        };

        jPlayer.prototype._resetMedia = function () {
            this._resetStatus();
            this._updateButtons(false);
            this._updateInterface();
            this._seeked();
            this.internal.poster.jq.hide();
            clearTimeout(this.internal.htmlDlyCmdId);
            if (this.html.active) {
                return this._html_resetMedia();
            } else if (this.flash.active) {
                return this._flash_resetMedia();
            }
        };

        jPlayer.prototype.clearMedia = function () {
            this._resetMedia();
            if (this.html.active) {
                this._html_clearMedia();
            } else if (this.flash.active) {
                this._flash_clearMedia();
            }
            this._resetGate();
            return this._resetActive();
        };

        jPlayer.prototype.load = function () {
            if (this.status.srcSet) {
                if (this.html.active) {
                    return this._html_load();
                } else if (this.flash.active) {
                    return this._flash_load();
                }
            } else {
                return this._urlNotSetError("load");
            }
        };

        jPlayer.prototype.play = function (time) {
            time = typeof time === "number" ? time : NaN;
            if (this.status.srcSet) {
                if (this.html.active) {
                    return this._html_play(time);
                } else if (this.flash.active) {
                    return this._flash_play(time);
                }
            } else {
                return this._urlNotSetError("play");
            }
        };

        jPlayer.prototype.videoPlay = function () {
            return this.play();
        };

        jPlayer.prototype.pause = function (time) {
            time = typeof time === "number" ? time : NaN;
            if (this.status.srcSet) {
                if (this.html.active) {
                    return this._html_pause(time);
                } else if (this.flash.active) {
                    return this._flash_pause(time);
                }
            } else {
                return this._urlNotSetError("pause");
            }
        };

        jPlayer.prototype.pauseOthers = function () {
            var instance, _i, _len, _ref, _results;
            _ref = jPlayer.instances;
            _results = [];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                instance = _ref[_i];
                if (this.element !== instance) {
                    if (instance.data("jPlayer").status.srcSet) {
                        _results.push(instance.jPlayer("pause"));
                    } else {
                        _results.push(void 0);
                    }
                } else {
                    _results.push(void 0);
                }
            }
            return _results;
        };

        jPlayer.prototype.stop = function () {
            if (this.status.srcSet) {
                if (this.html.active) {
                    return this._html_pause(0);
                } else if (this.flash.active) {
                    return this._flash_pause(0);
                }
            } else {
                return this._urlNotSetError("stop");
            }
        };

        jPlayer.prototype.playHead = function (p) {
            p = this._limitValue(p, 0, 100);
            if (this.status.srcSet) {
                if (this.html.active) {
                    return this._html_playHead(p);
                } else if (this.flash.active) {
                    return this._flash_playHead(p);
                }
            } else {
                return this._urlNotSetError("playHead");
            }
        };

        jPlayer.prototype._muted = function (muted) {
            this.options.muted = muted;
            if (this.html.used) this._html_mute(muted);
            if (this.flash.used) this._flash_mute(muted);
            if (!this.html.video.gate && !this.html.audio.gate) {
                this._updateMute(muted);
                this._updateVolume(this.options.volume);
                return this._trigger(jPlayer.event.volumechange);
            }
        };

        jPlayer.prototype.mute = function (mute) {
            mute = mute === void 0 ? true : !!mute;
            return this._muted(mute);
        };

        jPlayer.prototype.unmute = function (unmute) {
            unmute = unmute === void 0 ? true : !!unmute;
            return this._muted(!unmute);
        };

        jPlayer.prototype._updateMute = function (mute) {
            if (mute === void 0) mute = this.options.muted;
            if (this.css.jq.mute.length && this.css.jq.unmute.length) {
                if (this.status.noVolume) {
                    this.css.jq.mute.hide();
                    return this.css.jq.unmute.hide();
                } else if (mute) {
                    this.css.jq.mute.hide();
                    return this.css.jq.unmute.show();
                } else {
                    this.css.jq.mute.show();
                    return this.css.jq.unmute.hide();
                }
            }
        };

        jPlayer.prototype.volume = function (v) {
            v = this._limitValue(v, 0, 1);
            this.options.volume = v;
            if (this.html.used) this._html_volume(v);
            if (this.flash.used) this._flash_volume(v);
            if (!this.html.video.gate && !this.html.audio.gate) {
                this._updateVolume(v);
                return this._trigger(jPlayer.event.volumechange);
            }
        };

        jPlayer.prototype.volumeBar = function (e) {
            var h, offset, w, x, y;
            if (this.css.jq.volumeBar.length) {
                offset = this.css.jq.volumeBar.offset();
                x = e.pageX - offset.left;
                w = this.css.jq.volumeBar.width();
                y = this.css.jq.volumeBar.height() - e.pageY + offset.top;
                h = this.css.jq.volumeBar.height();
                if (this.options.verticalVolume) {
                    this.volume(y / h);
                } else {
                    this.volume(x / w);
                }
            }
            if (this.options.muted) return this._muted(false);
        };

        jPlayer.prototype.volumeBarValue = function (e) {
            return this.volumeBar(e);
        };

        jPlayer.prototype._updateVolume = function (v) {
            if (v === void 0) v = this.options.volume;
            v = this.options.muted ? 0 : v;
            if (this.status.noVolume) {
                if (this.css.jq.volumeBar.length) this.css.jq.volumeBar.hide();
                if (this.css.jq.volumeBarValue.length) this.css.jq.volumeBarValue.hide();
                if (this.css.jq.volumeMax.length) return this.css.jq.volumeMax.hide();
            } else {
                if (this.css.jq.volumeBar.length) this.css.jq.volumeBar.show();
                if (this.css.jq.volumeBarValue.length) {
                    this.css.jq.volumeBarValue.show();
                    this.css.jq.volumeBarValue[this.options.verticalVolume ? "height" : "width"]("" + (v * 100) + "%");
                }
                if (this.css.jq.volumeMax.length) return this.css.jq.volumeMax.show();
            }
        };

        jPlayer.prototype.volumeMax = function () {
            this.volume(1);
            if (this.options.muted) return this._muted(false);
        };

        jPlayer.prototype._cssSelectorAncestor = function (ancestor) {
            var cssSel, fn, _ref, _results;
            this.options.cssSelectorAncestor = ancestor;
            this._removeUiClass();
            this.ancestorJq = ancestor ? $(ancestor) : [];
            if (ancestor && this.ancestorJq.length !== 1) {
                this._warning({
                    type:$.jPlayer.warning.CSS_SELECTOR_COUNT,
                    context:ancestor,
                    message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.ancestorJq.length + " found for cssSelectorAncestor.",
                    hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT
                });
            }
            this._addUiClass();
            _ref = this.options.cssSelector;
            _results = [];
            for (fn in _ref) {
                cssSel = _ref[fn];
                _results.push(this._cssSelector(fn, cssSel));
            }
            return _results;
        };

        jPlayer.prototype._cssSelector = function (fn, cssSel) {
            if (typeof cssSel === 'string') {
                if (jPlayer.prototype.options.cssSelector[fn]) {
                    if (this.css.jq[fn] && this.css.jq[fn].length) {
                        this.css.jq[fn].unbind(".jPlayer");
                    }
                    this.options.cssSelector[fn] = cssSel;
                    this.css.cs[fn] = "" + this.options.cssSelectorAncestor + " " + cssSel;
                    if (cssSel) {
                        this.css.jq[fn] = $(this.css.cs[fn]);
                    } else {
                        this.css.jq[fn] = [];
                    }
                    if (this.css.jq[fn].length) {
                        this.css.jq[fn].bind("click.jPlayer", (function (e) {
                            this[fn](e);
                            $(this).blur();
                            return false;
                        }));
                    }
                    if (cssSel && this.css.jq[fn].length !== 1) {
                        return this._warning({
                            type:$.jPlayer.warning.CSS_SELECTOR_COUNT,
                            context:this.css.cs[fn],
                            message:$.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.css.jq[fn].length + " found for " + fn + " method.",
                            hint:$.jPlayer.warningHint.CSS_SELECTOR_COUNT
                        });
                    }
                } else {
                    return this._warning({
                        type:$.jPlayer.warning.CSS_SELECTOR_METHOD,
                        context:fn,
                        message:$.jPlayer.warningMsg.CSS_SELECTOR_METHOD,
                        hint:$.jPlayer.warningHint.CSS_SELECTOR_METHOD
                    });
                }
            } else {
                return this._warning({
                    type:$.jPlayer.warning.CSS_SELECTOR_STRING,
                    context:cssSel,
                    message:$.jPlayer.warningMsg.CSS_SELECTOR_STRING,
                    hint:$.jPlayer.warningHint.CSS_SELECTOR_STRING
                });
            }
        };

        jPlayer.prototype.seekBar = function (e) {
            var offset, p, w, x;
            if (this.css.jq.seekBar) {
                offset = this.css.jq.seekBar.offset();
                x = e.pageX - offset.left;
                w = this.css.jq.seekBar.width();
                p = 100 * x / w;
                return this.playHead(p);
            }
        };

        jPlayer.prototype.playBar = function (e) {
            return this.seekBar(e);
        };

        jPlayer.prototype.repeat = function () {
            return this._loop(true);
        };

        jPlayer.prototype.repeatOff = function () {
            return this._loop(false);
        };

        jPlayer.prototype._loop = function (isLoop) {
            if (this.options.loop !== isLoop) {
                this.options.loop = isLoop;
                this._updateButtons();
                return this._trigger(jPlayer.event.repeat);
            }
        };

        jPlayer.prototype.currentTime = function () {
            return {};
        };

        jPlayer.prototype.duration = function () {
            return {};
        };

        jPlayer.prototype.gui = function () {
            return {};
        };

        jPlayer.prototype.noSolution = function () {
            return {};
        };

        jPlayer.prototype.option = function (key, value) {
            var i, keys, opt, options, opts, _i, _len, _len2;
            options = key;
            if (arguments.length === 0) return $.extend(true, {}, this.options);
            if (typeof key === 'string') {
                keys = key.split(".");
                if (value === void 0) {
                    opt = $.extend(true, {}, this.options);
                    for (_i = 0, _len = keys.length; _i < _len; _i++) {
                        key = keys[_i];
                        if (opt[key] !== void 0) {
                            opt = opt[key];
                        } else {
                            this._warning({
                                type:$.jPlayer.warning.OPTION_KEY,
                                context:key,
                                message:$.jPlayer.warningMsg.OPTION_KEY,
                                hint:$.jPlayer.warningHint.OPTION_KEY
                            });
                            return;
                        }
                    }
                    return opt;
                }
                options = {};
                opts = options;
                for (i = 0, _len2 = keys.length; i < _len2; i++) {
                    key = keys[i];
                    if (i < keys.length - 1) {
                        opts[key] = {};
                        opts = opts[key];
                    } else {
                        opts[key] = value;
                    }
                }
            }
            this._setOptions(options);
            return this;
        };

        jPlayer.prototype._setOptions = function (options) {
            var key, value;
            for (key in options) {
                value = options[key];
                this._setOption(key, value);
            }
            return this;
        };

        jPlayer.prototype._setOption = function (key, value) {
            var cssSel, fn;
            switch (key) {
                case "volume":
                    this.volume(value);
                    break;
                case "muted":
                    this._muted(value);
                    break;
                case "cssSelectorAncestor":
                    this._cssSelectorAncestor(value);
                    break;
                case "cssSelector":
                    for (fn in value) {
                        cssSel = value[fn];
                        this._cssSelector(fn, cssSel);
                    }
                    break;
                case "fullScreen":
                    if (this.options[key] !== value) {
                        this._removeUiClass();
                        this.options[key] = value;
                        this._refreshSize();
                    }
                    break;
                case "size":
                case "sizeFull":
                    if (!this.options.fullScreen && this.options[key].cssClass !== value.cssClass) {
                        this._removeUiClass();
                    }
                    this.options[key] = $.extend({}, this.options[key], value);
                    this._refreshSize();
                    break;
                case "autohide":
                    this.options[key] = $.extend({}, this.options[key], value);
                    this._updateAutohide();
                    break;
                case "loop":
                    this._loop(value);
                    break;
                case "nativeVideoControls":
                case "noFullScreen":
                    this.options[key] = $.extend({}, this.options[key], value);
                    this.status.nativeVideoControls = this._uaBlocklist(this.options.nativeVideoControls);
                    this._restrictNativeVideoControls();
                    this._updateNativeVideoControls();
                    break;
                case "noVolume":
                    this.options[key] = $.extend({}, this.options[key], value);
                    this.status.noVolume = this._uaBlocklist(this.options.noVolume);
                    this._updateVolume();
                    this._updateMute();
                    break;
                case "emulateHtml":
                    if (this.options[key] !== value) {
                        this.options[key] = value;
                        if (value) {
                            this._emulateHtmlBridge();
                        } else {
                            this._destroyHtmlBridge();
                        }
                    }
            }
            return this;
        };

        jPlayer.prototype._refreshSize = function () {
            this._setSize();
            this._addUiClass();
            this._updateSize();
            this._updateButtons();
            this._updateAutohide();
            return this._trigger(jPlayer.event.resize);
        };

        jPlayer.prototype._setSize = function () {
            if (this.options.fullScreen) {
                this.status.width = this.options.sizeFull.width;
                this.status.height = this.options.sizeFull.height;
                this.status.cssClass = this.options.sizeFull.cssClass;
            } else {
                this.status.width = this.options.size.width;
                this.status.height = this.options.size.height;
                this.status.cssClass = this.options.size.cssClass;
            }
            return this.element.css({
                'width':this.status.width,
                'height':this.status.height
            });
        };

        jPlayer.prototype._addUiClass = function () {
            if (this.ancestorJq.length) {
                return this.ancestorJq.addClass(this.status.cssClass);
            }
        };

        jPlayer.prototype._removeUiClass = function () {
            if (this.ancestorJq.length) {
                return this.ancestorJq.removeClass(this.status.cssClass);
            }
        };

        jPlayer.prototype._updateSize = function () {
            this.internal.poster.jq.css({
                'width':this.status.width,
                'height':this.status.height
            });
            if (!this.status.waitForPlay && this.html.active && this.status.video || this.html.video.available && this.html.used && this.status.nativeVideoControls) {
                return this.internal.video.jq.css({
                    'width':this.status.width,
                    'height':this.status.height
                });
            } else if (!status.waitForPlay && this.flash.active && this.status.video) {
                return this.internal.flash.jq.css({
                    'width':this.status.width,
                    'height':this.status.height
                });
            }
        };

        jPlayer.prototype._updateAutohide = function () {
            var event, eventType, handler, namespace,
                _this = this;
            event = "mousemove.jPlayer";
            namespace = ".jPlayerAutohide";
            eventType = event + namespace;
            handler = function () {
                return _this.css.jq.gui.fadeIn(_this.options.autohide.fadeIn, function () {
                    clearTimeout(_this.internal.autohideId);
                    return _this.internal.autohideId = setTimeout((function () {
                        return _this.css.jq.gui.fadeOut(_this.options.autohide.fadeOut);
                    }), _this.options.autohide.hold);
                });
            };
            if (this.css.jq.gui.length) {
                this.css.jq.gui.stop(true, true);
                clearTimeout(this.internal.autohideId);
                if (!this.status.nativeVideoControls) {
                    if (this.options.fullScreen && this.options.autohide.full || !this.options.fullScreen && this.options.autohide.restored) {
                        this.element.bind(eventType, handler);
                        this.css.jq.gui.bind(eventType, handler);
                        return this.css.jq.gui.hide();
                    } else {
                        return this.css.jq.gui.show();
                    }
                } else {
                    return this.css.jq.gui.hide();
                }
            }
        };

        jPlayer.prototype.fullScreen = function () {
            return this._setOption("fullScreen", true);
        };

        jPlayer.prototype.restoreScreen = function () {
            return this._setOption("fullScreen", true);
        };

        jPlayer.prototype._html_initMedia = function () {
            this.htmlElement.media.src = this.status.src;
            if (this.options.preload !== 'none') this._html_load();
            return this._trigger(jPlayer.event.timeupdate);
        };

        jPlayer.prototype._html_setAudio = function (media) {
            var format, _i, _len, _ref;
            _ref = this.formats;
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                format = _ref[_i];
                if (this.html.support[format] && media[format]) {
                    this.status.src = media[format];
                    this.status.format[format] = true;
                    this.status.formatType = format;
                    break;
                }
            }
            this.htmlElement.media = this.htmlElement.audio;
            return this._html_initMedia();
        };

        jPlayer.prototype._html_setVideo = function (media) {
            var format, _i, _len, _ref;
            _ref = this.formats;
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                format = _ref[_i];
                if (this.html.support[format] && media[format]) {
                    this.status.src = media[format];
                    this.status.format[format] = true;
                    this.status.formatType = format;
                    break;
                }
            }
            if (this.status.nativeVideoControls) {
                this.htmlElement.video.poster = this._validString(media.poster) ? media.poster : "";
            }
            this.htmlElement.media = this.htmlElement.video;
            return this._html_initMedia();
        };

        jPlayer.prototype._html_resetMedia = function () {
            if (this.htmlElement.media) {
                if (this.htmlElement.media.id === this.internal.video.id && !this.status.nativeVideoControls) {
                    this.internal.video.jq.css({
                        'width':'0px',
                        'height':'0px'
                    });
                }
                return this.htmlElement.media.pause();
            }
        };

        jPlayer.prototype._html_clearmedia = function () {
            if (this.htmlElement.media) {
                this.htmlElement.media.src = "";
                return this.htmlElement.media.load();
            }
        };

        jPlayer.prototype._html_load = function () {
            if (this.status.waitForLoad) {
                this.status.waitForLoad = false;
                this.htmlElement.media.load();
            }
            return clearTimeout(this.internal.htmlDlyCmdId);
        };

        jPlayer.prototype._html_play = function (time) {
            var _this = this;
            this._html_load();
            this.htmlElement.media.play();
            if (!isNaN(time)) {
                try {
                    this.htmlElement.media.currentTime = time;
                } catch (err) {
                    this.internal.htmlDlyCmdId = setTimeout((function () {
                        return _this.play(time);
                    }), 100);
                    return;
                }
            }
            return this._html_checkWaitForPlay();
        };

        jPlayer.prototype._html_pause = function (time) {
            var _this = this;
            if (time > 0) {
                this._html_load();
            } else {
                clearTimeout(this.internal.htmlDlyCmdId);
            }
            this.htmlElement.media.pause();
            if (!isNaN(time)) {
                try {
                    this.htmlElement.media.currenttime = time;
                } catch (err) {
                    this.internal.htmlDlyCmdId = setTimeout((function () {
                        return jPlayer.pause(time);
                    }), 100);
                    return;
                }
            }
            if (time > 0) return this._html_checkWaitForPlay();
        };

        jPlayer.prototype._html_playHead = function (percent) {
            var _this = this;
            this._html_load();
            try {
                if (typeof this.htmlElement.media.seekable === "object" && this.htmlElement.media.seekable.length > 0) {
                    this.htmlElement.media.currentTime = percent * this.htmlElement.media.seekable.end(this.htmlElement.media.seekable.length - 1) / 100;
                } else if (this.htmlElement.media.duration > 0 && !isNaN(this.htmlElement.media.duration)) {
                    this.htmlElement.media.currentTime = percent * this.htmlElement.media.duration / 100;
                } else {
                    throw "e";
                }
            } catch (err) {
                this.internal.htmlDlyCmdId = setTimeout((function () {
                    return _this.playHead(percent);
                }), 100);
                return;
            }
            if (!this.status.waitForLoad) return this._html_checkWaitForPlay();
        };

        jPlayer.prototype._html_checkWaitForPlay = function () {
            if (this.status.waitForPlay) {
                this.status.waitForPlay = false;
                if (this.css.jq.videoPlay.length) this.css.jq.videoPlay.hide();
                if (this.status.video) {
                    this.internal.poster.jq.hide();
                    return this.internal.video.jq.css({
                        'width':this.status.width,
                        'height':this.status.height
                    });
                }
            }
        };

        jPlayer.prototype._html_volume = function (v) {
            if (this.html.audio.available) this.htmlElement.audio.volume = v;
            if (this.html.video.available) return this.htmlElement.video.volume = v;
        };

        jPlayer.prototype._html_mute = function (m) {
            if (this.html.audio.available) this.htmlElement.audio.muted = m;
            if (this.html.video.available) return this.htmlElement.video.muted = m;
        };

        jPlayer.prototype._flash_setAudio = function (media) {
            var format, _i, _len, _ref;
            try {
                _ref = this.formats;
                for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                    format = _ref[_i];
                    if (this.flash.support[format] && media[format]) {
                        switch (format) {
                            case "m4a":
                            case "fla":
                                this._getMovie().fl_setAudio_m4a(media[format]);
                                break;
                            case "mp3":
                                this._getMovie().fl_setAudio_mp3(media[format]);
                                break;
                            case "rtmpa":
                                this._getMovie().fl_setAudio_rtmp(media[format]);
                        }
                        this.status.src = media[format];
                        this.status.format[format] = true;
                        this.status.formatType = format;
                        break;
                    }
                }
                if (this.options.preload === 'auto') {
                    this._flash_load();
                    return this.status.waitForLoad = false;
                }
            } catch (err) {
                return this._flashError(err);
            }
        };

        jPlayer.prototype._flash_setVideo = function (media) {
            var format, _i, _len, _ref;
            try {
                _ref = this.formats;
                for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                    format = _ref[_i];
                    if (this.flash.support[format] && media[format]) {
                        switch (format) {
                            case "m4v":
                            case "flv":
                                this._getMovie().fl_setVideo_m4v(media[format]);
                                break;
                            case "rtmpv":
                                this._getMovie().fl_setVideo_rtmp(media[format]);
                        }
                        this.status.src = media[format];
                        this.status.format[format] = true;
                        this.status.formatType = format;
                        break;
                    }
                }
                if (this.options.preload === 'auto') {
                    this._flash_load();
                    return this.status.waitForLoad = false;
                }
            } catch (err) {
                return this._flashError(err);
            }
        };

        jPlayer.prototype._flash_resetMedia = function () {
            this.internal.flash.jq.css({
                'width':'0px',
                'height':'0px'
            });
            return this._flash_pause(NaN);
        };

        jPlayer.prototype._flash_clearMedia = function () {
            try {
                return this._getMovie().fl_clearMedia();
            } catch (err) {
                return this._flashError(err);
            }
        };

        jPlayer.prototype._flash_load = function () {
            try {
                this._getMovie().fl_load();
            } catch (err) {
                this._flashError(err);
            }
            return this.status.waitForLoad = false;
        };

        jPlayer.prototype._flash_play = function (time) {
            try {
                this._getMovie().fl_play(time);
            } catch (err) {
                this._flashError(err);
            }
            this.status.waitForLoad = false;
            return this._flash_checkWaitForPlay();
        };

        jPlayer.prototype._flash_pause = function (time) {
            try {
                this._getMovie().fl_pause(time);
            } catch (err) {
                this._flashError(err);
            }
            if (time > 0) {
                this.status.waitForLoad = false;
                return this._flash_checkWaitForPlay();
            }
        };

        jPlayer.prototype._flash_playHead = function (p) {
            try {
                this._getMovie().fl_play_head(p);
            } catch (err) {
                this._flashError(err);
            }
            if (!this.status.waitForLoad) return this._flash_checkWaitForPlay();
        };

        jPlayer.prototype._flash_checkWaitForPlay = function () {
            if (this.status.waitForPlay) {
                this.status.waitForPlay = false;
                if (this.css.jq.videoPlay.length) this.css.jq.videoPlay.hide();
                if (this.status.video) {
                    this.internal.poster.jq.hide();
                    return this.internal.flash.jq.css({
                        'width':this.status.width,
                        'height':this.status.height
                    });
                }
            }
        };

        jPlayer.prototype._flash_volume = function (v) {
            try {
                return this._getMovie()._flash_volume(v);
            } catch (err) {
                return this._flashError(err);
            }
        };

        jPlayer.prototype._flash_mute = function (m) {
            try {
                return this._getMovie()._flash_mute(m);
            } catch (err) {
                return this._flashError(err);
            }
        };

        jPlayer.prototype._getMovie = function () {
            return document[this.internal.flash.id];
        };

        jPlayer.prototype._checkForFlash = function (version) {
            var flash, flashIsInstalled, flashVersion;
            flashIsInstalled = false;
            flash = void 0;
            if (window.ActiveXObject) {
                try {
                    flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + version);
                    flashIsInstalled = true;
                } catch (e) {

                }
            } else if (navigator.plugins && navigator.mimeTypes.length > 0) {
                flash = navigator.plugins["Shockwave Flash"];
                if (flash) {
                    flashVersion = navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, "$1");
                    if (flashVersion >= version) flashIsInstalled = true;
                }
            }
            return flashIsInstalled;
        };

        jPlayer.prototype._validString = function (url) {
            return url && typeof url === "string";
        };

        jPlayer.prototype._limitValue = function (value, min, max) {
            if (value < min) {
                return min;
            } else {
                if (value > max) {
                    return max;
                } else {
                    return value;
                }
            }
        };

        jPlayer.prototype._urlNotSetError = function (context) {
            return this._error({
                type:$.jPlayer.error.URL_NOT_SET,
                context:context,
                message:$.jPlayer.errorMsg.URL_NOT_SET,
                hint:$.jPlayer.errorHint.URL_NOT_SET
            });
        };

        jPlayer.prototype._flashError = function (error) {
            var errorType;
            errorType = void 0;
            if (!this.internal.ready) {
                errorType = "FLASH";
            } else {
                errorType = "FLASH_DISABLED";
            }
            this._error({
                type:$.jPlayer.error[errorType],
                context:this.internal.flash.swf,
                message:$.jPlayer.errorMsg[errorType] + error.message,
                hint:$.jPlayer.errorHint[errorType]
            });
            return this.internal.flash.jq.css({
                'width':'1px',
                'height':'1px'
            });
        };

        jPlayer.prototype._error = function (error) {
            this._trigger(jPlayer.event.error, error);
            if (this.options.errorAlerts) {
                return this._alert("Error!" + (error.message ? "\n\n" + error.message : "") + (error.hint ? "\n\n" + error.hint : "") + "\n\nContext: " + error.context);
            }
        };

        jPlayer.prototype._warning = function (warning) {
            this._trigger(jPlayer.event.warning, void 0, warning);
            if (this.options.warningAlerts) {
                return this._alert("Warning!" + (warning.message ? "\n\n" + warning.message : "") + (warning.hint ? "\n\n" + warning.hint : "") + "\n\nContext: " + warning.context);
            }
        };

        jPlayer.prototype._alert = function (message) {
            return alert("jPlayer " + this.version.script + " : id='" + this.internal.self.id + "' : " + message);
        };

        jPlayer.prototype._emulateHtmlBridge = function () {
            var eventName, eventType, name, nativeEvent, _i, _j, _len, _len2, _ref, _ref2, _ref3, _results,
                _this = this;
            _ref = jPlayer.emulateMethods.split(/\s+/g);
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                name = _ref[_i];
                this.internal.domNode[name] = function (arg) {
                    return _this[name](arg);
                };
            }
            _ref2 = jPlayer.event;
            _results = [];
            for (eventName in _ref2) {
                eventType = _ref2[eventName];
                nativeEvent = true;
                _ref3 = jPlayer.reservedEvent.split(/\s+/g);
                for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) {
                    name = _ref3[_j];
                    if (name === eventName) {
                        nativeEvent = false;
                        break;
                    }
                }
                if (nativeEvent) {
                    _results.push(this.element.bind(eventType + ".jPlayer.jPlayerHtml", function () {
                        var domEvent;
                        _this._emulateHtmlUpdate();
                        domEvent = document.createEvent("Event");
                        return _this.internal.domNode.dispatchEvent(domEvent);
                    }));
                } else {
                    _results.push(void 0);
                }
            }
            return _results;
        };

        jPlayer.prototype._emulateHtmlUpdate = function () {
            var name, _i, _j, _len, _len2, _ref, _ref2, _results;
            _ref = jPlayer.emulateStatus.split(/\s+/g);
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                name = _ref[_i];
                this.internal.domNode[name] = this.status[name];
            }
            _ref2 = jPlayer.emulateOptions.split(/\s+/g);
            _results = [];
            for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
                name = _ref2[_j];
                _results.push(this.internal.domNode[name] = this.options[name]);
            }
            return _results;
        };

        jPlayer.prototype._destroyHtmlBridge = function () {
            var emulated, name, _i, _len, _ref, _results;
            this.element.unbind(".jPlayerHtml");
            emulated = jPlayer.emulateMethods + " " + jPlayer.emulateStatus + " " + jPlayer.emulateOptions;
            _ref = emulated.split(/\s+/g);
            _results = [];
            for (_i = 0, _len = _ref.length; _i < _len; _i++) {
                name = _ref[_i];
                _results.push(delete this.internal.domNode[name]);
            }
            return _results;
        };

        return jPlayer;

    })();

    jPlayer._static_init();

    $.jPlayer = jPlayer;

    $.jPlayer.error = {
        FLASH:"e_flash",
        FLASH_DISABLED:"e_flash_disabled",
        NO_SOLUTION:"e_no_solution",
        NO_SUPPORT:"e_no_support",
        URL:"e_url",
        URL_NOT_SET:"e_url_not_set",
        VERSION:"e_version"
    };

    $.jPlayer.errorMsg = {
        FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",
        FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",
        NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",
        NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",
        URL:"Media URL could not be loaded.",
        URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",
        VERSION:"jPlayer " + $.jPlayer.version.script + " needs Jplayer.swf version " + $.jPlayer.version.needFlash + " but found "
    };

    $.jPlayer.errorHint = {
        FLASH:"Check your swfPath option and that Jplayer.swf is there.",
        FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",
        NO_SOLUTION:"Review the jPlayer options: support and supplied.",
        NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",
        URL:"Check media URL is valid.",
        URL_NOT_SET:"Use setMedia() to set the media URL.",
        VERSION:"Update jPlayer files."
    };

    $.jPlayer.warning = {
        CSS_SELECTOR_COUNT:"e_css_selector_count",
        CSS_SELECTOR_METHOD:"e_css_selector_method",
        CSS_SELECTOR_STRING:"e_css_selector_string",
        OPTION_KEY:"e_option_key"
    };

    $.jPlayer.warningMsg = {
        CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",
        CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",
        CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",
        OPTION_KEY:"The option requested in jPlayer('option') is undefined."
    };

    $.jPlayer.warningHint = {
        CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",
        CSS_SELECTOR_METHOD:"Check your method name.",
        CSS_SELECTOR_STRING:"Check your css selector is a string.",
        OPTION_KEY:"Check your option name."
    };

    $.fn.jPlayer = function (options) {
        var args, isMethodCall, name, returnValue;
        name = 'jPlayer';
        isMethodCall = typeof options === 'string';
        args = Array.prototype.slice.call(arguments, 1);
        returnValue = this;
        if (!isMethodCall && args.length) {
            options = $.extend.apply(null, [true, options].concat(args));
        }
        if (isMethodCall && options.charAt(0) === "_") return returnValue;
        if (isMethodCall) {
            this.each(function () {
                var instance, methodValue;
                instance = $.data(this, name);
                methodValue = instance && $.isFunction(instance[options]) ? instance[options].apply(instance, args) : instance;
                if (methodValue !== instance && methodValue !== void 0) {
                    returnValue = methodValue;
                    return false;
                }
            });
        } else {
            this.each(function () {
                var instance;
                instance = $.data(this, name);
                if (instance) {
                    return instance.option(options || {});
                } else {
                    return $.data(this, name, new jPlayer(options, this));
                }
            });
        }
        return returnValue;
    };

})(jQuery);
